Repository navigation
Split audit report implementation into focused files - #76622
Conversation
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
| return []ValidationIssue{{ | ||
| Type: "agent_failure", | ||
| File: "agent-stdio.log", | ||
| Message: agentExcerpt, |
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
Reviewed the refactor diff. I found no new actionable correctness, performance, or maintainability issues in the changed lines. The existing sensitive-log disclosure concern is already present in the moved implementation and is covered by the existing review comment; I did not duplicate it. The specialist pass was unavailable because its file-read attempt was rejected by tool permissions, so this verdict is based on the independent diff review.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for this focused refactor, which is described as preserving the existing package API and behavior.
No open issues 🎉
What changed in this PR
Refactors the audit report implementation into focused files while preserving the existing package API and behavior.
Changes:
- Moved audit report data structures and MCP summary synchronization methods into
audit_report_types.go. - Moved file, manifest, and duration helpers into
audit_report_files.go. - Moved workflow step-log scanning and error extraction into
audit_step_errors.go. - Retained audit assembly and report-building logic in
audit_report.go.
| File | Description |
|---|---|
| pkg/cli/audit_step_errors.go | Contains workflow step-log scanning and failure-message extraction helpers. |
| pkg/cli/audit_report.go | Retains audit data assembly and report-building logic after the refactor. |
| pkg/cli/audit_report_types.go | Contains audit report data models and MCP tool summary synchronization methods. |
| pkg/cli/audit_report_files.go | Contains downloaded-file, manifest, file-description, and duration helpers. |
Review effort: Lite (auto)
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify that the implementation matches the decision. i️ Why this gate firedThe volume check counts added lines in business-logic directories such as
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design and /tdd to a pure file split. Approving, with one optional navigability nit inline.
📋 Key Themes & Highlights
Verification
- The removed and added lines match as multisets. The only net additions are blank lines, import blocks, and package headers, so the move is verbatim.
go build ./pkg/cli/passes, and the changed files are gofmt-clean.- Targeted audit tests (
go test ./pkg/cli/ -run Audit|ExtractAgent|...) pass.
Positive Highlights
- ✅ Responsibilities are split along clear seams: types, file extraction, and step-error scanning.
- ✅
audit_report.godrops from 1,201 lines to about 330.
Notes
- The shared
ghaLogTimestampPrefixPatternnow lives inaudit_step_errors.go, butaudit_engine_steps.goalso uses it. See the inline comment. - The bot-flagged excerpt disclosure concern at
audit_step_errors.go:241is pre-existing logic that moved here unchanged. It is not a regression from this PR.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| "github.com/github/gh-aw/pkg/stringutil" | ||
| ) | ||
|
|
||
| var ghaLogTimestampPrefixPattern = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}T`) |
There was a problem hiding this comment.
[/codebase-design] ghaLogTimestampPrefixPattern is declared in this file, but audit_engine_steps.go:848 also depends on it, so its owner is no longer obvious from that file.
💡 Suggested change
The pattern is a log-line parsing detail, and audit_engine_steps.go is the other consumer. Consider declaring it next to the timestamp handling in audit_engine_steps.go, or in another spot both files can find easily. This is a navigability nit. The build and targeted tests pass as-is.
@copilot please address this.
There was a problem hiding this comment.
Moved the shared pattern beside parseGHALogTimestamp in b3ea068. Focused audit tests pass.
| return nil | ||
| } | ||
|
|
||
| content, err := os.ReadFile(lastStep.path) |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "d52184a6004ee81ff8f63af6b7fa070b0f1bbbae",
"kind": "requested",
"schema_version": "1",
"state": "3d942b756995d70df154e6d54e76f46db62f59adce04a94de1fb9bcce233b17e",
"work": [
"99cd77d8dd2f817f4617e172931f575171b0436c6ae47ac2d3ed5aecf94714e0"
],
"workflow": "pr-sous-chef"
}
|
…actor-audit-report Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |
pkg/cli/audit_report.gohad grown to 1,201 lines, combining report types, data assembly, file extraction, and step-log error scanning.MCPToolSummarysync methods intoaudit_report_types.go.audit_report_files.go.audit_step_errors.go.audit_report.go.